package shortlink.config;

import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import shortlink.common.biz.user.UserInterceptor;

@Configuration
@RequiredArgsConstructor
public class WebMvcConfigration implements WebMvcConfigurer {

    private final UserInterceptor userInterceptor;
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(userInterceptor).addPathPatterns("/**").excludePathPatterns("/api/short-link/admin/user/login","/api/short-link/admin/user/hasusername","/api/short-link/admin/user/register");
    }
}
